package com.wxb.mybatis.service.impl;

import com.wxb.mybatis.beans.Dict;
import com.wxb.mybatis.dao.DictMapper;
import com.wxb.mybatis.service.DictService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Scope;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * describe:
 *
 * @author : 王校兵
 * @version : v1.0
 * @time : 2017-12-03 19:17
 */
@Scope(value = "prototype")
@Service
public class DictServiceImpl implements DictService {

	@Autowired
	private DictMapper mapper;

	@Override
	public String selectByKey() {
		List<String> result = mapper.selectByKey();
		return result.isEmpty() ? null : result.get(0);
	}

	@Override
	public Dict selectById(Integer id) {
		Dict result = mapper.selectById(id);
		return result;
	}
}
